Apeneck Sweeney
Vector Arithmetic

Author
HP-29C, 2019.06.27
support@BigCatOs.com

Theory
Grizzled bush pilot Apeneck Sweeney's converted Swordfish aircraft has a true air speed of 150 knots and an estimated heading of 45°. The Swordfish is also being buffeted by a headwind of 40 knots from a bearing of 25°. What is the actual ground speed and course of the Swordfish?

The course and ground speed are equal to the sum of the instrument vector (150 knots, 45°) and the wind vector (-40 knots, -25°), but since the wind vector opposes the instrument vector the result is a vector subtraction. (North becomes the x-coordinate so that the problem corresponds with navigational convention.)

The vectors are converted to rectangular coordinates and summed using the g and D keys. Using the f g key the result of the vector arithmetic is recalled from storage registers R.₁ (Σx) and R.₃ (Σy) and placed in the X and Y registers. The new summed rectangular coordinates are then converted back to polar coordinates to give the vector of the actual ground speed and course, (113.24 knots, 51.94°).

Instructions
To run, enter ¦ 0.

Program Listing
01 15 13 00 ; LBL 0
02 14 11 02 ; FIX 2
03    15 34 ; DEG
04    14 34 ; CLEAR 𝝨
05       04 ; 4
06       05 ; 5
07       31 ; ENTER
08       01 ; 1
09       05 ; 5
10       00 ; 0
11    14 44 ; ->R
12       25 ; Σ+
13       02 ; 2
14       05 ; 5
15       31 ; ENTER
16       04 ; 4
17       00 ; 0
18    14 44 ; ->R
19    14 25 ; Σ-
20    24 25 ; RCL Σ+
21    15 44 ; →P
22    14 74 ; PAUSE
23       21 ; Swap xy
24    14 74 ; PAUSE
25    15 12 ; RTN
26       74 ; R/S